<?php
/**
 * Created by : PhpStorm
 * User: DuFei
 * Date: 2020/7/17
 * Time: 13:40
 */

namespace app\exception;


class OaException extends \Exception
{
    protected $message;
    protected $code;

/*    public function __construct($code=0,$message){
        $this->message = $message;
        $this->code = $code;
        parent::__construct($message, $code);
    }*/

    public function __construct(array $array){

        $message = "";
        $code = 0;
        foreach($array as $k=>$v) {
            $message = $v;
            $code = $k;
        }
        $this->message = $message;
        $this->code = $code;
        parent::__construct($this->message, $this->code);
    }
}
